package com.ahsjdy.st.stbomanagerweb.config;

import com.ahsjdy.st.stbomanagerweb.filter.LoginFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Description
 * @Author xuetao wang
 * @Date 2020/8/2
 */
@Configuration
public class AppConfig implements WebMvcConfigurer {

    @Autowired
    private LoginFilter loginFilter;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(loginFilter).addPathPatterns("/user/**")
                .addPathPatterns("/view/**")
                .excludePathPatterns("/customer/**")
                .excludePathPatterns("/view/login")
                .excludePathPatterns("/user/login");
    }
}
